<?php
	require_once 'baza.inc.php';

	$q = $db->prepare("SELECT * FROM podrucje");
	$q->execute();

	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
	echo "<podrucja>\n";

	foreach ($q as $red){
		echo "\t<podrucje";
		echo " lat1=\"" . $red['latitude_1'];
		echo "\" lat2=\"" . $red['latitude_2'];
		echo "\" lng1=\"" . $red['longitude_1'];
		echo "\" lng2=\"" . $red['longitude_2'];
		echo "\" naziv=\"" . $red['Naziv'];
		echo "\" id=\"" . $red['idPodrucje'];
		echo "\" />\n";
	}

	echo '</podrucja>';

?>


